(() => {
    function eat(food) {
        return food + ':太好吃了';
    }
    let str = '苹果';
    console.log(eat(str));
    console.log("********************************");
    function dog_play(dog) {
        return "姓名：" + dog.name + "\n"
            + "年龄：" + dog.age + "\n"
            + "颜色：" + dog.color + "\n";
    }
    let dog = {
        name: '小白',
        age: 30,
        color: 1
    };
    console.log(dog_play(dog));
    console.log("********************************");
    //类的方式
    class Cat {
        constructor(name, age, color) {
            this.name = name;
            this.age = age;
            this.color = color;
        }
        cat_play() {
            return "姓名：" + this.name + "\n"
                + "年龄：" + this.age + "\n"
                + "颜色：" + this.color + "\n";
        }
    }
    let cat = new Cat("大黄", 29, 2);
    console.log(cat.cat_play());
    console.log("*************************************");
})();
